<html>
	<head>
		<script type="text/javascript">
			window.onload= function () { 
				var str = '   456652  9 74    ';
				var str2 = str.trim().replace(/\s/g,"");
				alert('---------'+str2+'--------');

			}
		</script>
	</head>
	<body>
		
	</body>
</html>